export const listMixins = {
  data() {
    return {}
  },
  methods: {
	listLoading(res){
		if(res.data.total == 0){
			this.listConfig.loading = 'list-not'
		}else if(res.data.total < res.data.size || res.data.current * res.data.size >= res.data.total){
			this.listConfig.loading = 'nomore'
		}
		this.listConfig.count = res.data.total
	},
	listMore(){
		const {current, size, count, loading} = this.listConfig
		if(loading == 'nomore' || loading == 'list-not' ){
			return
		}
		if(current*size < count){
			this.listConfig.current = current + 1
			this.getList()
		}else{
			this.listConfig.loading = 'nomore'
		}
	},
	getHeight(id){		
		uni.createSelectorQuery().selectAll(id).boundingClientRect(res => {
			console.log(res)
			uni.getSystemInfo({success:(sys)=>{
				let height = sys.windowHeight
				// let height = sys.screenHeight
				res.filter(item=>{
					height = height-item.height
				})
				const statusBarHeight = getApp().globalData.statusBarHeight
				console.log(statusBarHeight)
				if(statusBarHeight != 'undefined'){
					this.scrollHeight = height - (statusBarHeight/2)
				}else{
					this.scrollHeight = height
				}
			}})
		}).exec();
	}
  }
}

			